package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.Socket;
	
	public class Main extends Sprite 
	{
		
		private var _smptMail:SMTPMail;
		
		public function Main():void 
		{
			_smptMail = new SMTPMail(new Socket());
			_smptMail.addEventListener(Event.INIT, onInit);
			_smptMail.addEventListener(SMTPMail.LOGIN_ACCEPTED, onLogin);
			
			_smptMail.connect('smtp.mail.com', 25);
		}
		
		private function onInit(e:Event):void 
		{
			_smptMail.login('login@mail.com', 'yourPass');
		}
		
		private function onLogin(e:Event):void 
		{
			_smptMail.sendMail('from@mail.com', 'to@mail.com', 'Subject', 'message', fileByteArray, 'someFile.type');
		}
		
	}
	
}